package com.hitplane.elements 
{
	import com.hitplane.core.Bullet;
	import com.hitplane.manager.SoundManager;
	
	import flash.display.MovieClip;
	import flash.display.Shape;
	
	/**
	 * @describe  	普通的白色子弹
	 * @author  	郑子华
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		... 
	 */
	public class NormalWhitBullet extends Bullet
	{
		public function NormalWhitBullet() 
		{
			//设置子弹状态
			drawBullet();
			disappearBullet();
			reInit();
		}
		//private===============================================================
		private function drawBullet():void {
			var shape:Shape=new Shape();
			shape.graphics.clear();
			shape.graphics.beginFill(0xffffff, 1);
			shape.graphics.drawCircle(0, 0, 2);
			shape.graphics.endFill();
			registerState(bulletNormalState.stateType,shape);
		}
		private function disappearBullet():void{
			//设置子弹消失状态
			var disappearState:MovieClip=new Bullet_BombMc();
			registerState(bulletHitState.stateType,disappearState);
		}
		private function playSoundByBulletHit():void{
			SoundManager.instance.playSoundByType(SoundManager.instance.NORMAL_BULLET_HIT);
		}
		//override===============================================================
		override public function reInit():void 
		{
			super.reInit();
			setState(bulletNormalState);
			timeGap = 20;
			vx = 0;
			vy = 3;
		}
		override public function hasCollision():void 
		{
			super.hasCollision();
			playSoundByBulletHit();
		}
		
	}
	
}